package t2client;

import java.sql.SQLException;
import java.util.Scanner;

import t2invoke.Invoke;

public class Client {

	public static void main(String[] args) throws SQLException {
		Invoke in = new Invoke();
		Scanner sc = new Scanner(System.in);
		int n = 0;
		while (true) {
			System.out.println("输入1办卡");
			System.out.println("输入2添加新书");
			System.out.println("输入3借书");
			System.out.println("输入4还书");
			System.out.println("输入5查询所有书");
			System.out.println("输入6按卡号查询借阅记录");
			System.out.println("输入7按书名查询借阅记录");
			System.out.println("输入0退出");
			n = Integer.parseInt(sc.nextLine());
			switch (n) {
			case 1:
				in.addCard(sc);
				break;
			case 2:
				in.addBook(sc);
				break;
			case 3:
				in.lendBook(sc);
				break;
			case 4:
				in.backBook(sc);
				break;
			case 5:
				in.showBook();
				break;
			case 6:
				in.showCardLendRecord(sc);
				break;
			case 7:
				in.showBookLendRecord(sc);
				break;
			}
			if (n == 0) {
				break;
			}
		}
		sc.close();
//		in.addCard(sc);
//		in.lendBook(sc);
//		in.backBook(sc);
//		in.showBook();
//		in.showBookLendRecord(sc);
//		in.showCardLendRecord(sc);

	}

}
